﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WithInterfaces
{
    public class MenuItemException : Exception
    {
        private eMenuItemMessage m_MenuItemMessage = eMenuItemMessage.BackFromSubMenu;

        public MenuItemException(eMenuItemMessage i_MenuItemMessage)
        {
            m_MenuItemMessage = i_MenuItemMessage;
        }

        public eMenuItemMessage MenuItemMessage
        {
            get { return m_MenuItemMessage; }
        }

        public enum eMenuItemMessage
        {
            Exit = 0,
            BackFromSubMenu = 0,
            ExecuteFinished = 1,
            ReturnedFromSubMenu,
            OutOfRangeInput,
        }

        public new int GetType()
        {
            return (int)m_MenuItemMessage;
        }

        public override string ToString()
        {
            return m_MenuItemMessage.ToString();
        }
    }
}